<template>
  <!-- 指标集：中心结构 -->
  <div class="card-list">
    <div v-for="(item, i) in cardList" :key="i" class="card-item">
      <div>
        <div class="mt-10px">
          <span class="text-28px font-bold">{{ item.value }}</span>
          <span class="ml-5px pb-2px" style="vertical-align: 1px;">{{ item.unit }}</span>
        </div>
        <div class="text-12px">{{ item.label }}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
interface CardItem {
  label: string
  value: string | number
  unit?: string
}

interface Props {
  cardList: CardItem[]
}

withDefaults(defineProps<Props>(), {
  cardList: () => []
})
</script>

<style lang="scss" scoped>
.card-list {
  font-family: electronicFont;
  display: flex;
  flex-wrap: wrap;
}

.card-item {
  width: 130px;
  height: 130px;
  background: url('/imgs/business/visual-dark/statistic-bg-3-1.png');
  background-size: 100%;
  margin: 5px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;

  &.is-active {
    background: url('/imgs/business/visual-dark/statistic-bg-3-2.png');
    background-size: 100%; 
    cursor: pointer;
  }
}
</style>
